<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="w" uri="http://www.wangzhengshuang.com.cn/tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String jsPath = basePath + "js";
%>
<!DOCTYPE html>
<html lang="zh">
<head>
<title>首页</title>
<link href="/static/themes/bootstrap-3.0.3/bootstrap.min.css" rel="stylesheet">
<style>
.posts-pagination {
	text-align: center;
	margin-top: -30px;
	margin-bottom: -15px;
}

.post {
	border-bottom: 1px dotted #ccc;
	margin-bottom: 20px;
}

.post h3 a {
	text-decoration: none;
	color: #000000;
}

.post-bottom {
	margin-bottom: 10px;
}

.pagination li a {
	margin-left: 5px;
}
</style>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="posts col-md-8 col-md-offset-2">
				<c:forEach items="${listMap}" var="map">
					<div class="post">
						<h3><a href="/post/${map.id }">${map.title }</a></h3>
						<p>${map.content }</p>
						<div class="post-bottom">
							发布于 ${map.createdTime } <span>评论(${map.commentNum })</span> <span>阅读(${map.readNum })</span>
						</div>
					</div>
				</c:forEach>
				<div class="posts-pagination">
					<w:page baseUrl="/posts/##page##" pageNum="${page.pageNum }" pageSize="${page.pageSize }" totalNum="${page.totalNum }"/>
				</div>
			</div>
		</div>
	</div>
</body>
</html>